// 表单组件导入
import Vue from 'vue'

// Vite 的自动导入
const modules = import.meta.glob('../formComponents/**/*.vue', { eager: true })
const components = []

Object.values(modules).forEach(mod => {
  const componentEntity = mod.default
  components.push(componentEntity)
})

const dashboardPlugin = {
  install(Vue) {
    components.forEach(com => {
      com && com.name && Vue.component(com.name, com)
    })
  }
}
Vue.use(dashboardPlugin)

import FGDialog from "@/components/common/FGDialog.vue"
// 全局注册
const componentsAll = {
  install: function (Vue) {
    Vue.component('FGDialog', FGDialog)
  }
}
Vue.use(componentsAll)